package com.dokimall.ware.dao;

import com.dokimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author mori
 * @email 550144898@qq.com
 * @date 2021-09-26 17:22:13
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void addToWare(@Param("skuId") Long skuId, @Param("wareId") Long wareId,@Param("skuNum") Integer skuNum);

    Long getSkuStock(@Param("skuId") Long skuId);


    List<Long> getHasStockWareId(@Param("skuId") Long skuId,@Param("conut") Integer conut);

    Long lockSkuStock(@Param("wareId") Long wareId,@Param("skuId") Long skuId,@Param("num") Integer num);

    void unLockStock(@Param("skuId") Long skuId,@Param("wareId") Long wareId,@Param("skuNum") Integer skuNum);
}
